home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-4.0 / bfd / doc / syms.p < prev    next >
Encoding:
Text File  |  1991-09-29  |  4.8 KB  |  221 lines

  1. /* @subsection typedef asymbol
  2. An @code{asymbol} has the form:
  3. */
  4.  
  5. typedef struct symbol_cache_entry 
  6. {
  7. /* A pointer to the BFD which owns the symbol. This information is
  8. necessary so that a back end can work out what additional (invisible to
  9. the application writer) information is carried with the symbol. 
  10. */
  11.  
  12.   struct _bfd *the_bfd;
  13.  
  14. /*
  15. The text of the symbol. The name is left alone, and not copied - the
  16. application may not alter it. 
  17. */
  18.  
  19.    CONST char *name;
  20.  
  21. /*
  22. The value of the symbol.
  23. */
  24.  
  25.    symvalue value;
  26.  
  27. /*
  28. Attributes of a symbol:
  29. */
  30.  
  31. #define BSF_NO_FLAGS    0x00
  32.  
  33. /*
  34. The symbol has local scope; @code{static} in @code{C}. The value is
  35. the offset into the section of the data.
  36. */
  37.  
  38. #define BSF_LOCAL    0x01
  39.  
  40. /*
  41. The symbol has global scope; initialized data in @code{C}. The value
  42. is the offset into the section of the data.
  43. */
  44.  
  45. #define BSF_GLOBAL    0x02
  46.  
  47. /*
  48. Obsolete
  49. */
  50.  
  51. #define BSF_IMPORT    0x04
  52.  
  53. /*
  54. The symbol has global scope, and is exported. The value is the offset
  55. into the section of the data.
  56. */
  57.  
  58. #define BSF_EXPORT    0x08
  59.  
  60. /*
  61. The symbol is undefined. @code{extern} in @code{C}. The value has no meaning.
  62. */
  63.  
  64. #define BSF_UNDEFINED    0x10    
  65.  
  66. /*
  67. The symbol is common, initialized to zero; default in @code{C}. The
  68. value is the size of the object in bytes.
  69. */
  70.  
  71. #define BSF_FORT_COMM    0x20    
  72.  
  73. /*
  74. A normal @code{C} symbol would be one of:
  75. @code{BSF_LOCAL}, @code{BSF_FORT_COMM},  @code{BSF_UNDEFINED} or @code{BSF_EXPORT|BSD_GLOBAL}
  76.  
  77. The symbol is a debugging record. The value has an arbitary meaning.
  78. */
  79.  
  80. #define BSF_DEBUGGING    0x40
  81.  
  82. /*
  83. The symbol has no section attached, any value is the actual value and
  84. is not a relative offset to a section.
  85. */
  86.  
  87. #define BSF_ABSOLUTE    0x80
  88.  
  89. /*
  90. Used by the linker
  91. */
  92.  
  93. #define BSF_KEEP        0x10000
  94. #define BSF_KEEP_G      0x80000
  95.  
  96. /*
  97. Unused
  98. */
  99.  
  100. #define BSF_WEAK        0x100000
  101. #define BSF_CTOR        0x200000 
  102. #define BSF_FAKE        0x400000 
  103.  
  104. /*
  105. The symbol used to be a common symbol, but now it is allocated.
  106. */
  107.  
  108. #define BSF_OLD_COMMON  0x800000  
  109.  
  110. /*
  111. The default value for common data.
  112. */
  113.  
  114. #define BFD_FORT_COMM_DEFAULT_VALUE 0
  115.  
  116. /*
  117. In some files the type of a symbol sometimes alters its location
  118. in an output file - ie in coff a @code{ISFCN} symbol which is also @code{C_EXT}
  119. symbol appears where it was declared and not at the end of a section. 
  120. This bit is set by the target BFD part to convey this information. 
  121. */
  122.  
  123. #define BSF_NOT_AT_END    0x40000
  124.  
  125. /*
  126. Signal that the symbol is the label of constructor section.
  127. */
  128.  
  129. #define BSF_CONSTRUCTOR   0x1000000
  130.  
  131. /*
  132. Signal that the symbol is a warning symbol. If the symbol is a warning
  133. symbol, then the value field (I know this is tacky) will point to the
  134. asymbol which when referenced will cause the warning.
  135. */
  136.  
  137. #define BSF_WARNING       0x2000000
  138.  
  139. /*
  140. Signal that the symbol is indirect. The value of the symbol is a
  141. pointer to an undefined asymbol which contains the name to use
  142. instead.
  143. */
  144.  
  145. #define BSF_INDIRECT     0x4000000
  146.  
  147. /*
  148. */
  149.   flagword flags;
  150.  
  151. /*
  152. A pointer to the section to which this symbol is relative, or 0 if the
  153. symbol is absolute or undefined. Note that it is not sufficient to set
  154. this location to 0 to mark a symbol as absolute - the flag
  155. @code{BSF_ABSOLUTE} must be set also.
  156. */
  157.  
  158.   struct sec *section;
  159.  
  160. /*
  161. Back end special data. This is being phased out in favour of making
  162. this a union.
  163. */
  164.  
  165.   PTR udata;    
  166. } asymbol;
  167.  
  168. /*
  169.  
  170.  get_symtab_upper_bound
  171. Returns the number of bytes required in a vector of pointers to
  172. @code{asymbols} for all the symbols in the supplied BFD, including a
  173. terminal NULL pointer. If there are no symbols in the BFD, then 0 is
  174. returned.
  175. */
  176. #define get_symtab_upper_bound(abfd) \
  177.      BFD_SEND (abfd, _get_symtab_upper_bound, (abfd))
  178.  
  179. /*
  180.  
  181.  bfd_canonicalize_symtab
  182. Supplied a BFD and a pointer to an uninitialized vector of pointers.
  183. This reads in the symbols from the BFD, and fills in the table with
  184. pointers to the symbols, and a trailing NULL. The routine returns the
  185. actual number of symbol pointers not including the NULL.
  186. */
  187.  
  188. #define bfd_canonicalize_symtab(abfd, location) \
  189.      BFD_SEND (abfd, _bfd_canonicalize_symtab,\
  190.                   (abfd, location))
  191.  
  192. /*
  193.  bfd_set_symtab
  194. Provided a table of pointers to to symbols and a count, writes to the
  195. output BFD the symbols when closed.
  196. */
  197.  
  198.  PROTO(boolean, bfd_set_symtab, (bfd *, asymbol **, unsigned int ));
  199.  
  200. /*
  201.  
  202.  bfd_print_symbol_vandf
  203. Prints the value and flags of the symbol supplied to the stream file.
  204. */
  205.  
  206.  PROTO(void, bfd_print_symbol_vandf, (PTR file, asymbol *symbol));
  207.  
  208. /*
  209.  
  210.   bfd_make_empty_symbol
  211. This function creates a new @code{asymbol} structure for the BFD, and
  212. returns a pointer to it.
  213.  
  214. This routine is necessary, since each back end has private information
  215. surrounding the @code{asymbol}. Building your own @code{asymbol} and
  216. pointing to it will not create the private information, and will cause
  217. problems later on.
  218. */
  219. #define bfd_make_empty_symbol(abfd) \
  220.      BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
  221.